<?php
//------------------------------------------------------------------------
// | Author: 发仔 <i@fazi.me> 
// +----------------------------------------------------------------------

namespace app\admin\controller;

use think\Db;

class Menu extends Base
{
	
	protected $id = 'id';
	protected $table = 'menu';
	

	public function index() {

		$this->options();
		$this->assign('tree',$this->tree);
		return $this->out();
		
	}
	
	//处理数据
	protected function options($item = []) {
		
		$list = Db::name('menu')->where('module_type', 0)->whereNull('delete_time')->select();
		$this->tree = Arr2Sibling($list);
		$this->assign('pids', TplOptions($this->tree,$item['pid'],'name','id'));
		
		return $item;
	}
}   